package com.example.service;

import com.example.entity.User;
import com.example.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    public User Sel(int id){
        return userMapper.Sel(id);
    }

    public User add(User user) {
        userMapper.add(user);
        return user;
    }

    public User update(Integer id, User user) {
        user.setId(id);
        userMapper.update(user);
        return user;
    }

    public int del(Integer id) {
       return userMapper.del(id);
    }

    public List<User> ListUser() {
        return userMapper.ListUser();
    }


}
